﻿//  Copyright (c) 2011 Ray Liang (http://www.dotnetage.com)
//  Licensed MIT: http://www.opensource.org/licenses/mit-license.php
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using System.Data.Common;
using System.Data.Objects;
using System.Data.Entity.Infrastructure;

namespace DNA.Mvc.Data
{
    public class DB : DbContext
    {
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<WidgetInstance>()
                .Property(w => w.Data)
                .HasColumnType("image");
        }

        public DB() : base("DNADB") { }
        //public CoreDB(string nameOrConnectionString) : base(nameOrConnectionString) { }
        //public CoreDB(DbConnection existingConnection, bool contextOwnsConnection) : base(existingConnection,contextOwnsConnection) { }
        //public CoreDB(ObjectContext objectContext, bool dbContextOwnsObjectContext) : base(objectContext,dbContextOwnsObjectContext) { }
        //public CoreDB(string nameOrConnectionString, DbCompiledModel model) : base(nameOrConnectionString, model) { }
        //public CoreDB(DbConnection existingConnection, DbCompiledModel model, bool contextOwnsConnection) : base(existingConnection,model,contextOwnsConnection) { }

        public DbSet<Web> Webs { get; set; }

        public DbSet<WebPage> WebPages { get; set; }

        public DbSet<WebPageRole> WebPageRoles { get; set; }

        public DbSet<Permission> Permissions { get; set; }

        public DbSet<PermissionSet> PermissionSets { get; set; }

        public DbSet<WidgetInstance> Widgets { get; set; }

        public DbSet<WidgetDescriptor> WidgetDescriptors { get; set; }

        public DbSet<Subscription> Subscriptions { get; set; }

        public DbSet<OpenIdentity> OpenIDs { get; set; }

        public DbSet<PermissionRole> PermissionRoles { get; set; }

        public DbSet<PrivateMessage> Messages { get; set; }

       // public DbSet<Friend> Friends { get; set; }

        //public DbSet<Follower> Followers { get; set; }

       // public DbSet<Comment> Comments { get; set; }
    }

}
